<template>
  <div class="invitation">
    <div class="contentNav">
      <div class="tie flex flex-wrap">
        <div v-for="(item,index) in order" :key="index" class="item-box">
          <img class="head" :src="item.userPhoto" alt />
          <p class="hide_other">{{item.userName ? item.userName : '暂未设置'}}</p>
          <!-- <img @click.stop='gz(item.userId,item.isFollow)' src="../../../../public/images/qt_50.png" v-if='item.isFollow=="-1"' class="btn"  />
          <img @click.stop='gz(item.userId,item.isFollow)' src="../../../../public/images/qt_53.png" v-else class="btn" /> -->
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props:['userId'],
  name: "fans",
  data() {
    return {
      page:1,
      size:10,
      order:{},
      finished:false,
    };
  },
  created(){
    this.getMessage();
  },
  methods:{
    getMessage(){
      this.$get(this.$api.user.collectionsFollowers,{userId:this.userId}).then(data=>{
        data.data.curPageData.forEach((item,index,array)=>{
          if(!item.userPhoto) array[index].userPhoto=require('../../../../public/images/avtor.png');
        })
        this.order=data.data.curPageData;
        if(Number(this.page)*this.size>=data.data.totalNum) this.finished  = true;
        this.page=2;
      });
    },
    gz(userId,follow){
      let that=this;
      this.vueGz(userId,follow,function(){
        that.getMessage();
      })
    },
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.myInvitation {
  height: 1rem;
  background-color: #fff;
  font: 0.3rem/1rem "微软雅黑";
  color: #999999;
  margin-left: 0.3rem;
}
.tie {
  padding: 0.2rem 0.2rem 0 0.2rem;
  border-top: 0.3rem solid #f5f5f5;
}

.tie .item-box {
  width: 1.26rem;
  text-align: center;
  margin: 0 0.25rem 0.8rem 0.25rem;
}
.tie .item-box .head {
  width: 1.2rem;
  height: 1.2rem;
  display: block;
  border-radius: 50%;
  margin: 0 auto;
}
.tie .item-box p {
  width: 1.26rem;
  height: 0.28rem;
  font-size: 0.28rem;
  line-height: 0.28rem;
  padding: 0.17rem 0 0.3rem 0;
}
.tie .item-box .btn {
  width: 1.26rem;
  height: 0.46rem;
  display: block;
}
.contentNav{height: calc(100vh - 5rem - 44px);;overflow-y: scroll;background-color: #fff;}
</style>
